package cn.hxh.page.service.impl;

import cn.hxh.page.mapper.LinkMapper;
import cn.hxh.page.pojo.Link;
import cn.hxh.page.service.LinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: HongXiaoHan
 * @Description
 * @Date: 2020/10/6 13:00
 */
@Component
public class LinkServiceImpl implements LinkService {


    @Autowired
    private LinkMapper linkMapper;
    @Override
    public void addLink(String title, String url,String userId) {
        Link link = new Link();
        link.setTitle(title);
        link.setUrl(url);
        link.setUserId(userId);
        linkMapper.addLink(link);
    }

    @Override
    public List<Link> selectAllLink(String userId) {
        return linkMapper.selectAllLink(userId);
    }

    @Override
    public void deleteId(int id) {
        linkMapper.deleteId(id);
    }
}
